package com.example.custsecurity.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

import java.util.HashMap;
import java.util.Map;

@Slf4j
@RestController
public class MyController {

    @GetMapping("/say")
    public Map<String,Object> say(){
        Map<String,Object> map = new HashMap<>();
        map.put("say","你好");
        return map;
    }

    @GetMapping("/jump")
    public Map<String,Object> jump(){
        Map<String,Object> map = new HashMap<>();
        map.put("jump","你好");
        return map;
    }

    @GetMapping("/cry")
    public Map<String,Object> cry(){
        Map<String,Object> map = new HashMap<>();
        map.put("cry","你好");
        return map;
    }

    @GetMapping("/talk")
    public Map<String,Object> talk(){
        Map<String,Object> map = new HashMap<>();
        map.put("talk","你好");
        return map;
    }

    @GetMapping("/smile")
    public Map<String,Object> smile(){
        Map<String,Object> map = new HashMap<>();
        map.put("smile","你好");
        return map;
    }

    @RequestMapping("/")
    public ModelAndView login(){
        ModelAndView view = new ModelAndView();
        view.setViewName("/test.html");
        return view;
    }

    @RequestMapping("/logingprocess")
    @ResponseBody
    public String logprocess(@RequestParam("username") String username,@RequestParam("password") String password){
        log.debug("接收参数{}",username+"       "+password);
        return username+"       "+password;
    }

}
